import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex);

const state = {
	count:4
}
const mutations = {
	add(state,n){
		state.count+=n.a;
	}
}
const getters = {
	count:function(state){
		return state.count
	}
}
const actions = {
	jiaplus(context,n){
		context.commit('add',{'a':n})
	}
	/*jiaplus({commit}){
		commit('add',{'a':100})
	}*/
}
export default new Vuex.Store({
	state,
	mutations,
	getters,
	actions
})